package com.ludomancy.hugealien;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;

import com.ludomancy.gamelib.ResourceManager;
import com.ludomancy.gamelib.Utils;
import com.ludomancy.gamelib.Widget;

public class HelpWidget extends Widget
{
	
	public HelpWidget(Widget parent, Rectangle area)
	{
		super(parent, area);
	}
	
	public void update()
	{
	}
	
	public void paint(Graphics g)
	{
		g.setColor(Color.BLACK);
		g.fillRect(0, 0, getWidth(), getHeight());
		g.drawImage(ResourceManager.getImage("back.png"), 0, 0, getWidth(), getHeight(), 0, 0 , getWidth()/2, getHeight()/2, null);
		g.setColor(getTheme().getDefaultTextColor());
		g.setFont(getTheme().getDefaultFont());
		int offsetY = 10;
		String ins = "";
		ins += "The Raveler sees the bonds of affection between people and break weak ones. ";
		ins += "The Uruguayans have left their relationships go stale, thus the sky is silent. ";
		ins += "\rHelp them restore their complete happiness, or let pain destroy them.";
		ins += "\rHints about Uruguayans:";
		ins += "\n- Can never have more than two relationships.";
		ins += "\n- Broken ones are never healed.";
		ins += "\n- Press [R] to restart.";
		ins += "\rThe night can end in tragedy, struggle or joy.";
		Utils.drawMultiline(g, ins, getWidth()-10, 5, offsetY);
		Utils.drawString(g, " - Click Now -", getWidth()/2, getHeight()-60, Utils.ANCHOR_HCENTER);
	}

	public void mouseDown(Point pos)
	{
		leave();
	}

	
	public void leave()
	{
		HugeAlienApp.mainWidget.showGame();
	}
}
